import IPlot from '../interface/IPlot';
import {GisPlot, PlotTypes} from '../../../src';

/**
 * @Author : JiGuangJie
 * @Date : 2023/2/1
 * @Time : 上午11:33
 * @Version : 1.0.0
 * @description :
 */
export default class BasePlot implements IPlot {
    protected readonly _gisPlot: GisPlot;
    protected readonly _plotLayer: any;
    protected readonly _map: any;

    constructor(gisPlot: GisPlot, plotLayer: any, map: any) {
        this._gisPlot = gisPlot;
        this._plotLayer = plotLayer;
        this._map = map;
    }

    activate(type: PlotTypes | string, params: any): void {
        if (type === 'createPlot' || type === 'intoPlot' || type === 'sharePlot' || type === 'endPlot') {
            return;
        }
        this._gisPlot.plotEdit.deactivate();
        this._gisPlot.plotDraw.activate(type as PlotTypes, params);
    }
}